Integrand size = 40, antiderivative size = 72 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\left (\left (a^2 B-b^2 B-2 a b C\right ) x\right )-\frac {a^2 B \cot (c+d x)}{d}-\frac {b^2 C \log (\cos (c+d x))}{d}+\frac {a (2 b B+a C) \log (\sin (c+d x))}{d} \]
[Out]
Time = 0.24 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3713, 3685, 3705, 3556} \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-x \left (a^2 B-2 a b C-b^2 B\right )-\frac {a^2 B \cot (c+d x)}{d}+\frac {a (a C+2 b B) \log (\sin (c+d x))}{d}-\frac {b^2 C \log (\cos (c+d x))}{d} \]
[In]
[Out]
Rule 3556
Rule 3685
Rule 3705
Rule 3713
Rubi steps \begin{align*} \text {integral}& = \int \cot ^2(c+d x) (a+b \tan (c+d x))^2 (B+C \tan (c+d x)) \, dx \\ & = -\frac {a^2 B \cot (c+d x)}{d}+\int \cot (c+d x) \left (a (2 b B+a C)-\left (a^2 B-b^2 B-2 a b C\right ) \tan (c+d x)+b^2 C \tan ^2(c+d x)\right ) \, dx \\ & = -\left (\left (a^2 B-b^2 B-2 a b C\right ) x\right )-\frac {a^2 B \cot (c+d x)}{d}+\left (b^2 C\right ) \int \tan (c+d x) \, dx+(a (2 b B+a C)) \int \cot (c+d x) \, dx \\ & = -\left (\left (a^2 B-b^2 B-2 a b C\right ) x\right )-\frac {a^2 B \cot (c+d x)}{d}-\frac {b^2 C \log (\cos (c+d x))}{d}+\frac {a (2 b B+a C) \log (\sin (c+d x))}{d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.30 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.39 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {-2 a^2 B \cot (c+d x)+i (a+i b)^2 (B+i C) \log (i-\tan (c+d x))+2 a (2 b B+a C) \log (\tan (c+d x))-(a-i b)^2 (i B+C) \log (i+\tan (c+d x))}{2 d} \]
[In]
[Out]
Time = 0.35 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.17
method | result | size |
derivativedivides | \(\frac {B \,b^{2} \left (d x +c \right )-C \,b^{2} \ln \left (\cos \left (d x +c \right )\right )+2 B a b \ln \left (\sin \left (d x +c \right )\right )+2 C a b \left (d x +c \right )+B \,a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+C \,a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(84\) |
default | \(\frac {B \,b^{2} \left (d x +c \right )-C \,b^{2} \ln \left (\cos \left (d x +c \right )\right )+2 B a b \ln \left (\sin \left (d x +c \right )\right )+2 C a b \left (d x +c \right )+B \,a^{2} \left (-\cot \left (d x +c \right )-d x -c \right )+C \,a^{2} \ln \left (\sin \left (d x +c \right )\right )}{d}\) | \(84\) |
parallelrisch | \(\frac {\left (-2 B a b -C \,a^{2}+C \,b^{2}\right ) \ln \left (\sec \left (d x +c \right )^{2}\right )+\left (4 B a b +2 C \,a^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )-2 B \,a^{2} \cot \left (d x +c \right )-2 d x \left (B \,a^{2}-B \,b^{2}-2 C a b \right )}{2 d}\) | \(87\) |
norman | \(\frac {\left (-B \,a^{2}+B \,b^{2}+2 C a b \right ) x \tan \left (d x +c \right )^{2}-\frac {B \,a^{2} \tan \left (d x +c \right )}{d}}{\tan \left (d x +c \right )^{2}}+\frac {a \left (2 B b +C a \right ) \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {\left (2 B a b +C \,a^{2}-C \,b^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d}\) | \(107\) |
risch | \(-B \,a^{2} x +B \,b^{2} x +2 C a b x -\frac {2 i C \,a^{2} c}{d}+i C \,b^{2} x -i C \,a^{2} x -\frac {2 i B \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-2 i B a b x -\frac {4 i B a b c}{d}+\frac {2 i C \,b^{2} c}{d}+\frac {2 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) B b}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) C}{d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) C \,b^{2}}{d}\) | \(160\) |
[In]
[Out]
none
Time = 0.25 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.56 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {C b^{2} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right ) + 2 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} d x \tan \left (d x + c\right ) + 2 \, B a^{2} - {\left (C a^{2} + 2 \, B a b\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )}{2 \, d \tan \left (d x + c\right )} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 158 vs. \(2 (66) = 132\).
Time = 1.01 (sec) , antiderivative size = 158, normalized size of antiderivative = 2.19 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\begin {cases} \text {NaN} & \text {for}\: c = 0 \wedge d = 0 \\x \left (a + b \tan {\left (c \right )}\right )^{2} \left (B \tan {\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot ^{3}{\left (c \right )} & \text {for}\: d = 0 \\\text {NaN} & \text {for}\: c = - d x \\- B a^{2} x - \frac {B a^{2}}{d \tan {\left (c + d x \right )}} - \frac {B a b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{d} + \frac {2 B a b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + B b^{2} x - \frac {C a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {C a^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + 2 C a b x + \frac {C b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.38 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.29 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {2 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} {\left (d x + c\right )} + {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, {\left (C a^{2} + 2 \, B a b\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {2 \, B a^{2}}{\tan \left (d x + c\right )}}{2 \, d} \]
[In]
[Out]
none
Time = 1.67 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.64 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=-\frac {2 \, {\left (B a^{2} - 2 \, C a b - B b^{2}\right )} {\left (d x + c\right )} + {\left (C a^{2} + 2 \, B a b - C b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, {\left (C a^{2} + 2 \, B a b\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + \frac {2 \, {\left (C a^{2} \tan \left (d x + c\right ) + 2 \, B a b \tan \left (d x + c\right ) + B a^{2}\right )}}{\tan \left (d x + c\right )}}{2 \, d} \]
[In]
[Out]
Time = 8.56 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.39 \[ \int \cot ^3(c+d x) (a+b \tan (c+d x))^2 \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx=\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (C\,a^2+2\,B\,b\,a\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (-C+B\,1{}\mathrm {i}\right )\,{\left (-b+a\,1{}\mathrm {i}\right )}^2}{2\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (C+B\,1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^2}{2\,d}-\frac {B\,a^2\,\mathrm {cot}\left (c+d\,x\right )}{d} \]
[In]
[Out]